package org.dromara.system.domain.vo;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import org.dromara.common.json.handler.DecimalRemoveZeroSerializer;
import org.dromara.common.sensitive.annotation.Sensitive;
import org.dromara.common.sensitive.core.SensitiveStrategy;
import org.dromara.common.translation.annotation.Translation;
import org.dromara.common.translation.constant.TransConstant;
import org.dromara.system.domain.SysUser;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;


/**
 * 用户信息视图对象 sys_user
 *
 * @author Michelle.Chung
 */
@Data
@AutoMapper(target = SysUser.class)
public class SysUserVo implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 用户ID
     */
    private Long userId;

    /**
     * 租户ID
     */
    private String tenantId;

    /**
     * 部门ID
     */
    private Long deptId;

    /**
     * 用户账号
     */
    private String userName;

    /**
     * 用户昵称
     */
    private String nickName;

    /**
     * 用户类型（sys_user系统用户）
     */
    private String userType;

    /**
     * 用户邮箱
     */
    @Sensitive(strategy = SensitiveStrategy.EMAIL)
    private String email;

    /**
     * 手机号码
     */
//    @Sensitive(strategy = SensitiveStrategy.PHONE)
    private String phonenumber;

    /**
     * 用户性别（0男 1女 2未知）
     */
    private String sex;

    /**
     * 头像地址
     */
    @Translation(type = TransConstant.OSS_ID_TO_URL)
    private Long avatar;

    /**
     * 密码
     */
    @JsonIgnore
    @JsonProperty
    private String password;

    /**
     * 帐号状态（0正常 1停用）
     */
    private String status;

    /**
     * 最后登录IP
     */
    private String loginIp;

    /**
     * 最后登录时间
     */
    private Date loginDate;

    /**
     * 备注
     */
    private String remark;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 部门对象
     */
    private SysDeptVo dept;

    /**
     * 角色对象
     */
    private List<SysRoleVo> roles;

    /**
     * 角色组
     */
    private Long[] roleIds;

    /**
     * 岗位组
     */
    private Long[] postIds;

    /**
     * 数据权限 当前角色ID
     */
    private Long roleId;

    /**
     * 代理类型 0普通用户 1打手 2认证中
     */
    private String isWaiter;
    //游戏马甲
    private String gameName;
    //真实姓名
    private String relName;
    //手机号
    private String phone;
    //游戏id
    private String gameId;
    //游戏区服
    private String gameArea;
    //总充值金额
    @JsonSerialize(using = DecimalRemoveZeroSerializer.class)
    private BigDecimal allAmount;
    //今日收入
    @JsonSerialize(using = DecimalRemoveZeroSerializer.class)
    private BigDecimal dayAmount;
    //本周收入
    @JsonSerialize(using = DecimalRemoveZeroSerializer.class)
    private BigDecimal weekAmount;
    //本月收入
    @JsonSerialize(using = DecimalRemoveZeroSerializer.class)
    private BigDecimal monthAmount;
    //总订单
    private Integer allOrder;
    private Integer vip;
    //    @Translation(type = TransConstant.CONFIG_ID_TO_NAME, mapper = "vip", other = "vip")
    private String vipName;
    //vip图片
    private String vipUrl;
    //余额
    @JsonSerialize(using = DecimalRemoveZeroSerializer.class)
    private BigDecimal amount;
    //积分
    @JsonSerialize(using = DecimalRemoveZeroSerializer.class)
    private BigDecimal integral;
    //打手分成
    @JsonSerialize(using = DecimalRemoveZeroSerializer.class)
    private BigDecimal reward;
    //抽奖次数
    private Integer numberDraws;
    private Long qrCode;
    @Translation(type = TransConstant.OSS_ID_TO_URL, mapper = "qrCode")
    private String qrCodeUrl;
    /**
     * 打手关联的服务项目一级分类
     */
    private String typeIds;

    private List<String> typeListIds = new ArrayList<>();
    /**
     * 待接单
     */
    private Long order2;
    /**
     * 进行中
     */
    private Long order3;
    /**
     * 待确认
     */
    private Long order4;

    //打手进行中
    private Long dsOrder5;
    //打手待结单
    private Long dsOrder6;

    //打手等级
    private String dsVip;
    @Translation(type = TransConstant.CONFIG_ID_TO_NAME, mapper = "dsVip", other = "dsVip")
    private String dsVipName;
    //接单延迟时间 单位秒
    private Integer delayTime;
    //打手简介
    private String info;
}
